<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>提现结果</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="css/mui.min.css" rel="stylesheet" />
    <!--<link href="css/loading.css" rel="stylesheet" />-->
    <link href="css/antui.min.css" rel="stylesheet"/>
    <style>
        body{
            background-color: #FFF;
        }
        .wait,.info,.success,.pay-success,.fial,.error {
            display: none;
        }
    </style>
</head>
<body>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-pull-left"></a>
    <h1 class="mui-title">提现结果</h1>
    <span class="mui-icon mui-icon-close mui-pull-right" onclick="window.history.go(-5);"></span>
</header>

<div class="mui-content" style="background-color: white;">
    <div style="position: fixed;top: 25%;left: 0px;width: 100%;height: auto;">
        <div class="pay-success">
            <!--<div class="demo-type-title">支付成功</div>-->
            <div class="am-message result">
                <i class="am-icon result pay"></i>
                <div class="am-message-main">支付成功</div>
                <div class="am-message-em">50.00元</div>
                <div class="am-message-sub">当前可用额度6,000.00元</div>
            </div>

            <div class="am-message">
                <i class="am-icon message pay"></i>
                <div class="am-message-main">支付成功</div>
            </div>

            <div class="am-message multi">
                <i class="am-icon message pay"></i>
                <div class="am-message-main">主提示</div>
                <div class="am-message-sub">副提示</div>
            </div>
        </div>

        <!--<div class="demo-type-title">成功提示</div>-->
        <div class="success">
            <div class="am-message result">
                <i class="am-icon result success"></i>
                <div class="am-message-main success-main"></div>
                <div class="am-message-sub success-sub"></div>
            </div>

        </div>

        <!--<div class="demo-message-title">支付失败</div>-->
        <div class="error">
            <div class="am-message result">
                <i class="am-icon result error"></i>
                <div class="am-message-main error-main"></div>
                <div class="am-message-sub error-sub"></div>
            </div>
            <div class="am-message">
                <i class="am-icon message error"></i>
                <div class="am-message-main">失败</div>
            </div>
            <div class="am-message multi">
                <i class="am-icon message error"></i>
                <div class="am-message-main">主提示</div>
                <div class="am-message-sub">副提示</div>
            </div>
            <div class="am-message week">
                <i class="am-icon message-week error"></i>
                <div class="am-message-main">文字提示</div>
            </div>
        </div>

        <!--<div class="demo-message-title">无法完成</div>-->
        <div class="fial">
            <div class="am-message result">
                <i class="am-icon result warn"></i>
                <div class="am-message-main">无法完成操作</div>
                <div class="am-message-sub"></div>
            </div>
            <button class="am-button blue" style="margin: 10px 5%;width: 90%" onclick="reDeposit()">发起提现</button>
        </div>

        <!--<div class="demo-message-title">提示信息</div>-->
        <div class="info">
            <div class="am-message result">
                <i class="am-icon result info"></i>
                <div class="am-message-main">提示</div>
                <div class="am-message-sub">辅助信息</div>
            </div>
        </div>

        <!--<div class="demo-message-title">等待支付</div>-->
        <div class="wait">
            <div class="am-message result">
                <i class="am-icon result wait"></i>
                <div class="am-message-main">等待</div>
                <div class="am-message-sub">已提交申请，等待银行处理</div>
            </div>
        </div>
    </div>

</div>
<div class="mui-popup-backdrop mui-active" style="display: none; background-color: transparent;">

    <div class="am-toast">
        <div class="am-toast-text">
            <span class="am-icon toast loading"></span> 查询中
        </div>
    </div>
</div>
<!--<div class="loading">s-->
<!---->
<!--</div>-->
<script src="js/mui.min.js"></script>
<script src="js/app.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script>
    var status = null;
    var orderNum = null;
    var amount = null;
    var summary = null;
    mui.init({
        swipeBack: true //启用右滑关闭功能
    });
    function reDeposit() {
        var btn = mui('.am-button');
        var data = {
            "payerId": sessionStorage.getItem("payerId"),
            "orderNum": orderNum,
            "amount": amount,
            "summary": summary,
            "isRedeposit":1
        };
        $('.mui-popup-backdrop').css('display','block');
        btn.button('loading');
        $.ajax({
            url: '/thmlfApi/avs/pay/deposit'+"?_d="+Date.parse(new Date()),
            type: 'POST',
            data: JSON.stringify(data),
            dataType: 'JSON',
            contentType: "application/json",
            success: function(r) {
                $('.mui-popup-backdrop').css('display','none');
                btn.button('reset');
                if(r.code == 200) {
                    mui.toast("发起提现成功");
//                    window.history.go(-4);
                } else
                    mui.alert(r.message);
            },
            error: function(e) {
                $('.mui-popup-backdrop').css('display','none');
                btn.button('reset');
                mui.alert("请求失败，请重试");
            }
        })
    }
    mui.ready(function () {
        status = getUrlParam('code');
        orderNum = getUrlParam('orderNum');
        amount = getUrlParam('amount');
        summary = getUrlParam('summary');
//        status = '2001';
        console.log("code",status);
        switch (status){
            case '1001':
                // 已经结算成功
                $('.success').css('display','block');
                $('.success>.am-message>.am-message-main').text("结算成功");
                $('.success>.am-message>.am-message-sub').text("此订单已经结算成功，如长时间未到账，请联系客服。");
                break;
            case '1002':
                // 通道已经接收
                $('.info').css('display','block');
                $('.info>.am-message>.am-message-main').text("信息已接受");
                $('.info>.am-message>.am-message-sub').text("结算信息已接受，正在处理中，如长时间未到账，请联系客服。");
                break;
            case '1003':
                // 通道正在处理
                $('.wait').css('display','block');
                $('.wait>.am-message>.am-message-main').text("结算处理中");
                $('.wait>.am-message>.am-message-sub').text("结算信息正在处理中，如长时间未到账，请联系客服。");
                break;
            case '2001':
                // 结算失败
                $('.fial').css('display','block');
                $('.fial>.am-message>.am-message-main').text("结算失败");
                $('.fial>.am-message>.am-message-sub').text("结算失败，请注意结算卡信息正确，可发起重新提现。如多次失败，请联系客服。");
                break;
            case '2002':
                // 未结算
                $('.fial').css('display','block');
                $('.fial>.am-message>.am-message-main').text("结算失败");
                $('.fial>.am-message>.am-message-sub').text("结算失败，请注意结算卡信息正确，可发起重新提现。如多次失败，请联系客服。");
                break;
        }
    });
</script>
</body>
</html>